ruleset=load('top5.ms.txt');

rulesetmean=[ruleset(:,1),ruleset(:,3),ruleset(:,5),ruleset(:,7),ruleset(:,9)];
[row col]=size(rulesetmean);

rulesetw1=[ruleset(:,3),ruleset(:,5),ruleset(:,7),ruleset(:,9)];
rulesetw2=[ruleset(:,1),ruleset(:,5),ruleset(:,7),ruleset(:,9)];
rulesetw3=[ruleset(:,1),ruleset(:,3),ruleset(:,7),ruleset(:,9)];
rulesetw4=[ruleset(:,1),ruleset(:,3),ruleset(:,5),ruleset(:,9)];
rulesetw5=[ruleset(:,1),ruleset(:,3),ruleset(:,5),ruleset(:,7)];
    

val13w1=abs(rulesetw1(1,:)-rulesetw1(3,:));
val14w1=abs(rulesetw1(1,:)-rulesetw1(4,:));
val23w1=abs(rulesetw1(2,:)-rulesetw1(3,:));
val24w1=abs(rulesetw1(2,:)-rulesetw1(4,:));
val=[val13w1,val14w1,val23w1,val24w1];
minvalw1=min(val);

val13w2=abs(rulesetw2(1,:)-rulesetw2(3,:));
val14w2=abs(rulesetw2(1,:)-rulesetw2(4,:));
val23w2=abs(rulesetw2(2,:)-rulesetw2(3,:));
val24w2=abs(rulesetw2(2,:)-rulesetw2(4,:));
val=[val13w2,val14w2,val23w2,val24w2];
minvalw2=min(val);

val13w3=abs(rulesetw3(1,:)-rulesetw3(3,:));
val14w3=abs(rulesetw3(1,:)-rulesetw3(4,:));
val23w3=abs(rulesetw3(2,:)-rulesetw3(3,:));
val24w3=abs(rulesetw3(2,:)-rulesetw3(4,:));
val=[val13w3,val14w3,val23w3,val24w3];
minvalw3=min(val);

val13w4=abs(rulesetw4(1,:)-rulesetw4(3,:));
val14w4=abs(rulesetw4(1,:)-rulesetw4(4,:));
val23w4=abs(rulesetw4(2,:)-rulesetw4(3,:));
val24w4=abs(rulesetw4(2,:)-rulesetw4(4,:));
val=[val13w4,val14w4,val23w4,val24w4];
minvalw4=min(val);

val13w5=abs(rulesetw5(1,:)-rulesetw5(3,:));
val14w5=abs(rulesetw5(1,:)-rulesetw5(4,:));
val23w5=abs(rulesetw5(2,:)-rulesetw5(3,:));
val24w5=abs(rulesetw5(2,:)-rulesetw5(4,:));
val=[val13w5,val14w5,val23w5,val24w5];
minvalw5=min(val);

diffpeak=[];
for i=1:row
    for j=1:row
        if(i<j)
            diffpeak=[diffpeak,abs(rulesetmean(i,:)-rulesetmean(j,:))];
        end
    end
end


